package org.weasel.views;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.part.ViewPart;

public class Welcome extends ViewPart {

	public static final String ID = "org.weasel.views.Welcome"; // TODO Needs to be whatever is mentioned in plugin.xml

	private Composite top = null;

	private Composite composite = null;

	private StyledText styledText = null;

	private Label label = null;

	@Override
	public void createPartControl(Composite parent) {
		// TODO Auto-generated method stub
		parent.setLayout(new FillLayout());
		top = new Composite(parent, SWT.NONE);
		createComposite();
		top.setLayout(new GridLayout());
	}

	@Override
	public void setFocus() {
		// TODO Auto-generated method stub

	}

	/**
	 * This method initializes composite	
	 *
	 */
	private void createComposite() {
		GridData gridData2 = new GridData();
		gridData2.horizontalAlignment = org.eclipse.swt.layout.GridData.CENTER;
		GridData gridData1 = new GridData();
		gridData1.horizontalAlignment = GridData.CENTER;
		gridData1.grabExcessHorizontalSpace = true;
		gridData1.grabExcessVerticalSpace = true;
		gridData1.verticalAlignment = GridData.CENTER;
		GridLayout gridLayout1 = new GridLayout();
		gridLayout1.numColumns = 2;
		GridData gridData = new GridData();
		gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.CENTER;
		composite = new Composite(top, SWT.NONE);
		composite.setLayout(gridLayout1);
		composite.setLayoutData(gridData1);
		label = new Label(composite, SWT.HORIZONTAL);
		label.setText("Label");
		label.setLayoutData(gridData);
		label.setImage(new Image(Display.getCurrent(), getClass().getResourceAsStream("/icons/logo.gif")));
		styledText = new StyledText(composite, SWT.READ_ONLY);
		styledText.setText("Welcome to the Weasel Agile Project Planner\n\nThis application is thought to help You to manage\nprojects, releases, iterations and user stories");
		styledText.setLayoutData(gridData2);
		styledText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
	}

}  //  @jve:decl-index=0:visual-constraint="10,10,423,220"
